Skip to content

Conversation

@Coussecousse
Copy link
Contributor

@Coussecousse Coussecousse commented Oct 10, 2025

Hi !

I refactored the code and implemented the space chart based on Chamilo v1.
I also added the ability to view other teachers’ spaces (it just felt right somehow).
I’m not sure if it works with groups, since I couldn’t find where to test that — hopefully someone can check! Theoretically, it should 😆

I hope my code is fine !

Issue : #6719

Screens :
Capture d’écran du 2025-10-10 15-35-30

If error :
Capture d’écran du 2025-10-10 15-30-56
(It is centered, I fixed it in the commit Minor — I just took the screenshot before noticing it wasn’t.)

⚠️ To test sessions, I had to create one and try it through another teacher. I noticed it didn’t work at first, so I fixed it — I’ll create another PR for that.

Copy link
Member

@ywarnier ywarnier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Files in src/CoreBundle/Migrations should not be modified in this PR. Please remove them or close this PR to open a new one without these.

See other change requests. Many small things to change, but overall a very good job code-wise (haven't tried running it yet).

public function __invoke($cid): JsonResponse
{
$courseId = (int) $cid;
$sessionId = api_get_session_id();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use CidReqHelper::getSessionId() for $sessionId and CidReqHelper::getGroupId() for $groupId.

return new JsonResponse(['error' => 'Course not found'], 404);
}

$sessionEntity = api_get_session_entity();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use CidReqHelper::getSessionEntity()

}

// Path filtering - convert document.lib.php logic to Doctrine
if ('/' !== $path) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like the old files strategy of looking at file paths to define hierarchies. This is not the way this should be done in Chamilo 2.0. Rather, you should use ResourceFile and ResourceNode entities for that (ask if you need more details)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants